package com.gt.wxpay.cashier.domain.model;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ChannelPayTypeEnum {
    JSAPI(0, "JSAPI"),
    NATIVE(1, "NATIVE"),
    H5(2, "H5");
    private final int code;
    private final String desc;

    public static ChannelPayTypeEnum getByName(String name){
        for (ChannelPayTypeEnum value : ChannelPayTypeEnum.values()) {
            if(value.name().equalsIgnoreCase(name)){
                return value;
            }
        }
        return JSAPI;
    }
}
